for t in $(ls main)
do
  tablename=${t%_*}
  cat >>main/${tablename}_main.sh<<EOF

mysql -uroot  -proot -e "replace into result.res_update(res_table) VALUES('${tablename}')"
EOF
done
